var mobiscroll = mobiscroll || {};
(function(e, b, c) {
    var n = {
            "column-count": 1,
			columns: 1,
			"font-weight": 1,
			"line-height": 1,
			opacity: 1,
			"z-index": 1,
			zoom: 1
        },
        p = {
            'readonly': 'readOnly'
        },
        j = [],
        f = Array.prototype.slice;

    function d(a) {
		
        return typeof a === (false ? "" : "function");
    }

    function h(a) {
        return typeof a === (true ? "object" : "");
    }

    function k(a) {
        return typeof a.length == (true ? 'number' : "");
    }

    function l(a) {
        return a.replace(/-+(.)?/g, function(b, a) {
            return a ? a.toUpperCase() : '';
        });
    }

    function m(e, d, f) {
        for (var b in d) {
            if (f && (a.isPlainObject(d[b]) || a.isArray(d[b]))) {
                if (a.isPlainObject(d[b]) && !a.isPlainObject(e[b]) || a.isArray(d[b]) && !a.isArray(e[b])) {
                    e[b] = {};
                }
                m(e[b], d[b], f);
            } else if (d[b] !== c) {
                e[b] = d[b];
            }
        }
    }

    function g(a) {
        return a.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase()
    }

    function o(b, a) {
        return typeof a == "number" && !n[g(b)] ? a + "px" : a;
    }
    var i = function() {
        var i = function(c) {
            var d = this,
                b = 0;
            for (b = 0; b < c.length; b++) {
                d[b] = c[b];
            }
            d.length = c.length;
            return a(this);
        };
        var a = function(c, k) {
            var h = [],
                f = 0;
            if (c && !k) {
                if (c instanceof i) {
                    return c;
                }
            }
            if (d(c)) {
                return a(b).ready(c);
            }
            if (c) {
                if (typeof c === 'string') {
                    var l, m, g;
                    c = g = c.trim();
                    if (g.indexOf('<') >= 0 && g.indexOf('>') >= 0) {
                        var j = 'div';
                        if (g.indexOf('<li') === 0) {
                            j = 'ul';
                        }
                        if (g.indexOf('<tr') === 0) {
                            j = 'tbody';
                        }
                        if (g.indexOf('<td') === 0 || g.indexOf('<th') === 0) {
                            j = 'tr';
                        }
                        if (g.indexOf('<tbody') === 0) {
                            j = 'table';
                        }
                        if (g.indexOf('<option') === 0) {
                            j = 'select';
                        }
                        m = b.createElement(j);
                        m.innerHTML = g;
                        for (f = 0; f < m.childNodes.length; f++) {
                            h.push(m.childNodes[f]);
                        }
                    } else {
                        if (!k && c[0] === '#' && !c.match(/[ .<>:~]/)) {
                            l = [b.getElementById(c.split('#')[1])];
                        } else {
                            if (k instanceof i) {
                                k = k[0];
                            }
                            l = (k || b).querySelectorAll(c);
                        }
                        for (f = 0; f < l.length; f++) {
                            if (l[f]) {
                                h.push(l[f]);
                            }
                        }
                    }
                } else if (c.nodeType || c === e || c === b) {
                    h.push(c);
                } else if (c.length > 0 && c[0].nodeType) {
                    for (f = 0; f < c.length; f++) {
                        h.push(c[f]);
                    }
                } else if (a.isArray(c)) {
                    h = c;
                }
            }
            return new i(h);
        };
        i.prototype = {
            ready: function(c) {
                if (/complete|loaded|interactive/.test(b.readyState) && b.body) {
                    c(a);
                } else {
                    b.addEventListener('DOMContentLoaded', function() {
                        c(a);
                    }, false);
                }
                return this;
            },
            concat: j.concat,
            empty: function() {
                return this.each(function() {
                    this.innerHTML = '';
                });
            },
            map: function(b) {
                return a(a.map(this, function(a, c) {
                    return b.call(a, c, a);
                }));
            },
            slice: function() {
                return a(f.apply(this, arguments));
            },
            addClass: function(d) {
                if (typeof d === 'undefined') {
                    return this;
                }
                var c = d.split(' ');
                for (var a = 0; a < c.length; a++) {
                    for (var b = 0; b < this.length; b++) {
                        if (typeof this[b].classList !== 'undefined' && c[a] !== '') {
                            this[b].classList.add(c[a]);
                        }
                    }
                }
                return this;
            },
            removeClass: function(d) {
                var c = d.split(' ');
                for (var a = 0; a < c.length; a++) {
                    for (var b = 0; b < this.length; b++) {
                        if (typeof this[b].classList !== 'undefined' && c[a] !== '') {
                            this[b].classList.remove(c[a]);
                        }
                    }
                }
                return this;
            },
            hasClass: function(a) {
                return this[0] ? this[0].classList.contains(a) : false;
            },
            toggleClass: function(d) {
                var c = d.split(' ');
                for (var b = 0; b < c.length; b++) {
                    for (var a = 0; a < this.length; a++) {
                        if (typeof this[a].classList !== 'undefined') {
                            this[a].classList.toggle(c[b]);
                        }
                    }
                }
                return this;
            },
            closest: function(d, e) {
                var b = this[0],
                    c = false;
                if (h(d)) {
                    c = a(d);
                }
                while (b && !(c ? c.indexOf(b) >= 0 : a.matches(b, d))) {
                    b = b !== e && b.nodeType !== b.DOCUMENT_NODE && b.parentNode;
                }
                return a(b);
            },
            attr: function(a, f) {
                var e;
                if (arguments.length === 1 && typeof a === 'string' && this.length) {
                    e = this[0].getAttribute(a);
                    return this[0] && (e || e === '') ? e : c;
                } else {
                    for (var b = 0; b < this.length; b++) {
                        if (arguments.length === 2) {
                            this[b].setAttribute(a, f);
                        } else {
                            for (var d in a) {
                                this[b][d] = a[d];
                                this[b].setAttribute(d, a[d]);
                            }
                        }
                    }
                    return this;
                }
            },
            removeAttr: function(b) {
                for (var a = 0; a < this.length; a++) {
                    this[a].removeAttribute(b);
                }
                return this;
            },
            prop: function(a, d) {
                a = p[a] || a;
                if (arguments.length === 1 && typeof a === 'string') {
                    return this[0] ? this[0][a] : c;
                } else {
                    for (var b = 0; b < this.length; b++) {
                        this[b][a] = d;
                    }
                    return this;
                }
            },
            val: function(d) {
                if (typeof d === 'undefined') {
                    if (this.length && this[0].multiple) {
                        return a.map(this.find('option:checked'), function(a) {
                            return a.value;
                        });
                    }
                    return this[0] ? this[0].value : c;
                }
                if (this.length && this[0].multiple) {
                    a.each(this[0].options, function() {
                        this.selected = d.indexOf(this.value) != -1;
                    });
                } else {
                    for (var b = 0; b < this.length; b++) {
                        this[b].value = d;
                    }
                }
                return this;
            },
            on: function(k, g, f, h) {
                var e = k.split(' '),
                    c, b;

                function i(e) {
                    var b, c, d = e.target;
                    if (a(d).is(g)) {
                        f.call(d, e);
                    } else {
                        c = a(d).parents();
                        for (b = 0; b < c.length; b++) {
                            if (a(c[b]).is(g)) {
                                f.call(c[b], e);
                            }
                        }
                    }
                }

                function j(a, e, c, d) {
                    var b = e.split('.');
                    if (!a.DomNameSpaces) {
                        a.DomNameSpaces = [];
                    }
                    a.DomNameSpaces.push({
                        namespace: b[1],
                        event: b[0],
                        listener: c,
                        capture: d
                    });
                    a.addEventListener(b[0], c, d);
                }
                for (c = 0; c < this.length; c++) {
                    if (d(g) || g === false) {
                        if (d(g)) {
                            h = f || false;
                            f = g;
                        }
                        for (b = 0; b < e.length; b++) {
                            if (e[b].indexOf('.') != -1) {
                                j(this[c], e[b], f, h);
                            } else {
                                this[c].addEventListener(e[b], f, h);
                            }
                        }
                    } else {
                        for (b = 0; b < e.length; b++) {
                            if (!this[c].DomLiveListeners) {
                                this[c].DomLiveListeners = [];
                            }
                            this[c].DomLiveListeners.push({
                                listener: f,
                                liveListener: i
                            });
                            if (e[b].indexOf('.') != -1) {
                                j(this[c], e[b], i, h);
                            } else {
                                this[c].addEventListener(e[b], i, h);
                            }
                        }
                    }
                }
                return this;
            },
            off: function(k, h, f, i) {
                var e, c, a, g, b = this;

                function j(h) {
                    var a, c, d, e = h.split('.'),
                        f = e[0],
                        g = e[1];
                    for (a = 0; a < b.length; ++a) {
                        if (b[a].DomNameSpaces) {
                            for (c = 0; c < b[a].DomNameSpaces.length; ++c) {
                                d = b[a].DomNameSpaces[c];
                                if (d.namespace == g && (d.event == f || !f)) {
                                    b[a].removeEventListener(d.event, d.listener, d.capture);
                                    d.removed = true;
                                }
                            }
                            for (c = b[a].DomNameSpaces.length - 1; c >= 0; --c) {
                                if (b[a].DomNameSpaces[c].removed) {
                                    b[a].DomNameSpaces.splice(c, 1);
                                }
                            }
                        }
                    }
                }
                e = k.split(' ');
                for (c = 0; c < e.length; c++) {
                    for (a = 0; a < this.length; a++) {
                        if (d(h) || h === false) {
                            if (d(h)) {
                                i = f || false;
                                f = h;
                            }
                            if (e[c].indexOf('.') === 0) {
                                j(e[c].substr(1), f, i);
                            } else {
                                this[a].removeEventListener(e[c], f, i);
                            }
                        } else {
                            if (this[a].DomLiveListeners) {
                                for (g = 0; g < this[a].DomLiveListeners.length; g++) {
                                    if (this[a].DomLiveListeners[g].listener === f) {
                                        this[a].removeEventListener(e[c], this[a].DomLiveListeners[g].liveListener, i);
                                    }
                                }
                            }
                            if (this[a].DomNameSpaces && this[a].DomNameSpaces.length && e[c]) {
                                j(e[c]);
                            }
                        }
                    }
                }
                return this;
            },
            trigger: function(g, f) {
                var d = g.split(' ');
                for (var c = 0; c < d.length; c++) {
                    for (var e = 0; e < this.length; e++) {
                        var a;
                        try {
                            a = new CustomEvent(d[c], {
                                detail: f,
                                bubbles: true,
                                cancelable: true
                            });
                        } catch (e) {
                            a = b.createEvent('Event');
                            a.initEvent(d[c], true, true);
                            a.detail = f;
                        }
                        this[e].dispatchEvent(a);
                    }
                }
                return this;
            },
            width: function(a) {
                if (a !== c) {
                    return this.css('width', a);
                }
                if (this[0] === e) {
                    return e.innerWidth;
                } else if (this[0] === b) {
                    return b.documentElement.scrollWidth;
                } else {
                    return this.length > 0 ? parseFloat(this.css('width')) : null;
                }
            },
            height: function(f) {
                if (f !== c) {
                    return this.css('height', f);
                }
                if (this[0] === e) {
                    return e.innerHeight;
                } else if (this[0] === b) {
                    var d = b.body,
                        a = b.documentElement;
                    return Math.max(d.scrollHeight, d.offsetHeight, a.clientHeight, a.scrollHeight, a.offsetHeight);
                } else {
                    return this.length > 0 ? parseFloat(this.css('height')) : null;
                }
            },
            innerWidth: function() {
                var b = this;
                if (this.length > 0) {
                    if (this[0].innerWidth) {
                        return this[0].innerWidth;
                    } else {
                        var a = this[0].offsetWidth,
                            c = ['left', 'right'];
                        c.forEach(function(c) {
                            a -= parseInt(b.css(l('border-' + c + '-width')) || 0, 10);
                        });
                        return a;
                    }
                }
            },
            innerHeight: function() {
                var b = this;
                if (this.length > 0) {
                    if (this[0].innerHeight) {
                        return this[0].innerHeight;
                    } else {
                        var a = this[0].offsetHeight,
                            c = ['top', 'bottom'];
                        c.forEach(function(c) {
                            a -= parseInt(b.css(l('border-' + c + '-width')) || 0, 10);
                        });
                        return a;
                    }
                }
            },
            offset: function() {
                if (this.length > 0) {
                    var a = this[0],
                        c = a.getBoundingClientRect(),
                        d = b.body,
                        f = a.clientTop || d.clientTop || 0,
                        g = a.clientLeft || d.clientLeft || 0,
                        h = e.pageYOffset || a.scrollTop,
                        i = e.pageXOffset || a.scrollLeft;
                    return {
                        top: c.top + h - f,
                        left: c.left + i - g
                    };
                }
            },
            hide: function() {
                for (var a = 0; a < this.length; a++) {
                    this[a].style.display = 'none';
                }
                return this;
            },
            show: function() {
                for (var a = 0; a < this.length; a++) {
                    if (this[a].style.display == "none") {
                        this[a].style.display = '';
                    }
                    if (getComputedStyle(this[a], '').getPropertyValue("display") == "none") {
                        this[a].style.display = 'block';
                    }
                }
                return this;
            },
            clone: function() {
                return this.map(function() {
                    return this.cloneNode(true);
                });
            },
            styles: function() {
                return this[0] ? e.getComputedStyle(this[0], null) : c;
            },
            css: function(a, f) {
                var c, b, d = this[0],
                    e = '';
                if (arguments.length < 2) {
                    if (!d) {
                        return;
                    }
                    if (typeof a === 'string') {
                        return d.style[a] || getComputedStyle(d, '').getPropertyValue(a);
                    }
                }
                if (typeof a === 'string') {
                    if (!f && f !== 0) {
                        this.each(function() {
                            this.style.removeProperty(g(a));
                        });
                    } else {
                        e = g(a) + ":" + o(a, f);
                    }
                } else {
                    for (b in a) {
                        if (!a[b] && a[b] !== 0) {
                            for (c = 0; c < this.length; c++) {
                                this[c].style.removeProperty(g(b));
                            }
                        } else {
                            e += g(b) + ':' + o(b, a[b]) + ';';
                        }
                    }
                }
                return this.each(function() {
                    this.style.cssText += ';' + e;
                });
            },
            each: function(b) {
                for (var a = 0; a < this.length; a++) {
                    if (b.apply(this[a], [a, this[a]]) === false) {
                        break;
                    }
                }
                return this;
            },
            filter: function(e) {
                var c = [];
                for (var b = 0; b < this.length; b++) {
                    if (d(e)) {
                        if (e.call(this[b], b, this[b])) {
                            c.push(this[b]);
                        }
                    } else if (a.matches(this[b], e)) {
                        c.push(this[b]);
                    }
                }
                return new i(c);
            },
            html: function(b) {
                if (typeof b === 'undefined') {
                    return this[0] ? this[0].innerHTML : c;
                } else {
                    this.empty();
                    for (var a = 0; a < this.length; a++) {
                        this[a].innerHTML = b;
                    }
                    return this;
                }
            },
            text: function(b) {
                if (typeof b === 'undefined') {
                    return this[0] ? this[0].textContent.trim() : null;
                } else {
                    for (var a = 0; a < this.length; a++) {
                        this[a].textContent = b;
                    }
                    return this;
                }
            },
            is: function(b) {
                return this.length > 0 && a.matches(this[0], b);
            },
            not: function(b) {
                var g = [];
                if (d(b) && b.call !== c) {
                    this.each(function(a) {
                        if (!b.call(this, a)) {
                            g.push(this);
                        }
                    });
                } else {
                    var e = typeof b == 'string' ? this.filter(b) : k(b) && d(b.item) ? f.call(b) : a(b);
                    if (h(e)) {
                        e = a.map(e, function(a) {
                            return a;
                        });
                    }
                    this.each(function(b, a) {
                        if (e.indexOf(a) < 0) {
                            g.push(a);
                        }
                    });
                }
                return a(g);
            },
            indexOf: function(b) {
                for (var a = 0; a < this.length; a++) {
                    if (this[a] === b) {
                        return a;
                    }
                }
            },
            index: function(b) {
                return b ? this.indexOf(a(b)[0]) : this.parent().children().indexOf(this[0]);
            },
            get: function(a) {
                return a === c ? f.call(this) : this[a >= 0 ? a : a + this.length];
            },
            eq: function(a) {
                if (typeof a === 'undefined') {
                    return this;
                }
                var b = this.length,
                    c;
                if (a > b - 1) {
                    return new i([]);
                }
                if (a < 0) {
                    c = b + a;
                    return c < 0 ? new i([]) : new i([this[c]]);
                }
                return new i([this[a]]);
            },
            append: function(a) {
                var c, d;
                for (c = 0; c < this.length; c++) {
                    if (typeof a === 'string') {
                        var e = b.createElement('div');
                        e.innerHTML = a;
                        while (e.firstChild) {
                            this[c].appendChild(e.firstChild);
                        }
                    } else if (a instanceof i) {
                        for (d = 0; d < a.length; d++) {
                            this[c].appendChild(a[d]);
                        }
                    } else {
                        this[c].appendChild(a);
                    }
                }
                return this;
            },
            appendTo: function(b) {
                a(b).append(this);
                return this;
            },
            prepend: function(d) {
                var a, c;
                for (a = 0; a < this.length; a++) {
                    if (typeof d === 'string') {
                        var e = b.createElement('div');
                        e.innerHTML = d;
                        for (c = e.childNodes.length - 1; c >= 0; c--) {
                            this[a].insertBefore(e.childNodes[c], this[a].childNodes[0]);
                        }
                    } else if (d instanceof i) {
                        for (c = 0; c < d.length; c++) {
                            this[a].insertBefore(d[c], this[a].childNodes[0]);
                        }
                    } else {
                        this[a].insertBefore(d, this[a].childNodes[0]);
                    }
                }
                return this;
            },
            prependTo: function(b) {
                a(b).prepend(this);
                return this;
            },
            insertBefore: function(e) {
                var b = a(e);
                for (var c = 0; c < this.length; c++) {
                    if (b.length === 1) {
                        b[0].parentNode.insertBefore(this[c], b[0]);
                    } else if (b.length > 1) {
                        for (var d = 0; d < b.length; d++) {
                            b[d].parentNode.insertBefore(this[c].cloneNode(true), b[d]);
                        }
                    }
                }
                return this;
            },
            insertAfter: function(e) {
                var b = a(e);
                for (var c = 0; c < this.length; c++) {
                    if (b.length === 1) {
                        b[0].parentNode.insertBefore(this[c], b[0].nextSibling);
                    } else if (b.length > 1) {
                        for (var d = 0; d < b.length; d++) {
                            b[d].parentNode.insertBefore(this[c].cloneNode(true), b[d].nextSibling);
                        }
                    }
                }
                return this;
            },
            next: function(b) {
                if (this.length > 0) {
                    if (b) {
                        if (this[0].nextElementSibling && a(this[0].nextElementSibling).is(b)) {
                            return new i([this[0].nextElementSibling]);
                        } else {
                            return new i([]);
                        }
                    } else {
                        if (this[0].nextElementSibling) {
                            return new i([this[0].nextElementSibling]);
                        } else {
                            return new i([]);
                        }
                    }
                } else {
                    return new i([]);
                }
            },
            nextAll: function(e) {
                var d = [],
                    b = this[0];
                if (!b) {
                    return new i([]);
                }
                while (b.nextElementSibling) {
                    var c = b.nextElementSibling;
                    if (e) {
                        if (a(c).is(e)) {
                            d.push(c);
                        }
                    } else {
                        d.push(c);
                    }
                    b = c;
                }
                return new i(d);
            },
            prev: function(b) {
                if (this.length > 0) {
                    if (b) {
                        if (this[0].previousElementSibling && a(this[0].previousElementSibling).is(b)) {
                            return new i([this[0].previousElementSibling]);
                        } else {
                            return new i([]);
                        }
                    } else {
                        if (this[0].previousElementSibling) {
                            return new i([this[0].previousElementSibling]);
                        } else {
                            return new i([]);
                        }
                    }
                } else {
                    return new i([]);
                }
            },
            prevAll: function(e) {
                var d = [];
                var b = this[0];
                if (!b) {
                    return new i([]);
                }
                while (b.previousElementSibling) {
                    var c = b.previousElementSibling;
                    if (e) {
                        if (a(c).is(e)) {
                            d.push(c);
                        }
                    } else {
                        d.push(c);
                    }
                    b = c;
                }
                return new i(d);
            },
            parent: function(d) {
                var c = [];
                for (var b = 0; b < this.length; b++) {
                    if (this[b].parentNode !== null) {
                        if (d) {
                            if (a(this[b].parentNode).is(d)) {
                                c.push(this[b].parentNode);
                            }
                        } else {
                            c.push(this[b].parentNode);
                        }
                    }
                }
                return a(a.unique(c));
            },
            parents: function(e) {
                var c = [];
                for (var d = 0; d < this.length; d++) {
                    var b = this[d].parentNode;
                    while (b) {
                        if (e) {
                            if (a(b).is(e)) {
                                c.push(b);
                            }
                        } else {
                            c.push(b);
                        }
                        b = b.parentNode;
                    }
                }
                return a(a.unique(c));
            },
            find: function(e) {
                var c = [];
                for (var a = 0; a < this.length; a++) {
                    var d = this[a].querySelectorAll(e);
                    for (var b = 0; b < d.length; b++) {
                        c.push(d[b]);
                    }
                }
                return new i(c);
            },
            children: function(f) {
                var d = [];
                for (var e = 0; e < this.length; e++) {
                    var c = this[e].childNodes;
                    for (var b = 0; b < c.length; b++) {
                        if (!f) {
                            if (c[b].nodeType === 1) {
                                d.push(c[b]);
                            }
                        } else {
                            if (c[b].nodeType === 1 && a(c[b]).is(f)) {
                                d.push(c[b]);
                            }
                        }
                    }
                }
                return new i(a.unique(d));
            },
            remove: function() {
                for (var a = 0; a < this.length; a++) {
                    if (this[a].parentNode) {
                        this[a].parentNode.removeChild(this[a]);
                    }
                }
                return this;
            },
            add: function() {
                var b = this;
                var c, d;
                for (c = 0; c < arguments.length; c++) {
                    var e = a(arguments[c]);
                    for (d = 0; d < e.length; d++) {
                        b[b.length] = e[d];
                        b.length++;
                    }
                }
                return b;
            },
            before: function(b) {
                a(b).insertBefore(this);
                return this;
            },
            after: function(b) {
                a(b).insertAfter(this);
                return this;
            },
            scrollTop: function(a) {
                if (!this.length) {
                    return;
                }
                var b = 'scrollTop' in this[0];
                if (a === c) {
                    return b ? this[0].scrollTop : this[0].pageYOffset;
                }
                return this.each(b ? function() {
                    this.scrollTop = a;
                } : function() {
                    this.scrollTo(this.scrollX, a);
                });
            },
            scrollLeft: function(a) {
                if (!this.length) {
                    return;
                }
                var b = 'scrollLeft' in this[0];
                if (a === c) {
                    return b ? this[0].scrollLeft : this[0].pageXOffset;
                }
                return this.each(b ? function() {
                    this.scrollLeft = a;
                } : function() {
                    this.scrollTo(a, this.scrollY);
                });
            },
            contents: function() {
                return this.map(function(b, a) {
                    return f.call(a.childNodes);
                });
            },
            nextUntil: function(d) {
                var b = this,
                    c = [];
                while (b.length && !b.filter(d).length) {
                    c.push(b[0]);
                    b = b.next();
                }
                return a(c);
            },
            prevUntil: function(d) {
                var b = this,
                    c = [];
                while (b.length && !a(b).filter(d).length) {
                    c.push(b[0]);
                    b = b.prev();
                }
                return a(c);
            },
            detach: function() {
                return this.remove();
            }
        };
        a.fn = i.prototype;
        return a;
    }();
    var a = i;
    mobiscroll.$ = i;
    a.inArray = function(a, b, c) {
        return j.indexOf.call(b, a, c);
    };
    a.extend = function(a) {
        var c, b = f.call(arguments, 1);
        if (typeof a == 'boolean') {
            c = a;
            a = b.shift();
        }
        a = a || {};
        b.forEach(function(b) {
            m(a, b, c);
        });
        return a;
    };
    a.isFunction = d;
    a.isArray = function(a) {
        return Object.prototype.toString.apply(a) === '[object Array]';
    };
    a.isPlainObject = function(a) {
        return h(a) && a !== null && a !== a.window && Object.getPrototypeOf(a) == Object.prototype;
    };
    a.each = function(b, e) {
        var c, d;
        if (!h(b) || !e) {
            return;
        }
        if (a.isArray(b) || b instanceof i) {
            for (c = 0; c < b.length; c++) {
                if (e.call(b[c], c, b[c]) === false) {
                    break;
                }
            }
        } else {
            for (d in b) {
                if (b.hasOwnProperty(d) && d !== 'length') {
                    if (e.call(b[d], d, b[d]) === false) {
                        break;
                    }
                }
            }
        }
        return this;
    };
    a.unique = function(c) {
        var b = [];
        for (var a = 0; a < c.length; a++) {
            if (b.indexOf(c[a]) === -1) {
                b.push(c[a]);
            }
        }
        return b;
    };
    a.map = function(d, g) {
        var b, c = [],
            e, f;
        if (k(d)) {
            for (e = 0; e < d.length; e++) {
                b = g(d[e], e);
                if (b !== null) {
                    c.push(b);
                }
            }
        } else {
            for (f in d) {
                b = g(d[f], f);
                if (b !== null) {
                    c.push(b);
                }
            }
        }
        return c.length > 0 ? a.fn.concat.apply([], c) : c;
    };
    a.matches = function(a, b) {
        if (!b || !a || a.nodeType !== 1) {
            return false;
        }
        var c = a.matchesSelector || a.webkitMatchesSelector || a.mozMatchesSelector || a.msMatchesSelector;
        return c.call(a, b);
    };
}(window, document));(function() {
    return function(v, j, g) {
        function k(a) {
            var b;
            for (b in a) {
                if (o[a[b]] !== g) {
                    return true;
                }
            }
            return false;
        }

        function t() {
            var a = ['Webkit', 'Moz', 'O', 'ms'],
                b;
            for (b in a) {
                if (k([a[b] + 'Transform'])) {
                    return '-' + a[b].toLowerCase() + '-';
                }
            }
            return '';
        }

        function n(c, a, e) {
            var d = c;
            if (typeof a === 'object') {
                return c.each(function() {
                    if (b[this.id]) {
                        b[this.id].destroy();
                    }
                    new mobiscroll.classes[a.component || 'Scroller'](this, a);
                });
            }
            if (typeof a === 'string') {
                c.each(function() {
                    var f, c = b[this.id];
                    if (c && c[a]) {
                        f = c[a].apply(this, Array.prototype.slice.call(e, 1));
                        if (f !== g) {
                            d = f;
                            return false;
                        }
                    }
                });
            }
            return d;
        }
        var d, i, e, a = typeof jQuery == 'undefined' ? mobiscroll.$ : jQuery,
            r = +new Date(),
            b = {},
            c = a.extend,
            m = navigator.userAgent,
            f = m.match(/Android|iPhone|iPad|iPod|Windows Phone|Windows|MSIE/i),
            o = j.createElement('modernizr').style,
            p = k(['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']),
            q = k(['flex', 'msFlex', 'WebkitBoxDirection']),
            l = t(),
            s = l.replace(/^\-/, '').replace(/\-$/, '').replace('moz', 'Moz'),
            h = [];
        if (/Android/i.test(f)) {
            i = 'android';
            e = navigator.userAgent.match(/Android\s+([\d\.]+)/i);
            if (e) {
                h = e[0].replace('Android ', '').split('.');
            }
        } else if (/iPhone|iPad|iPod/i.test(f)) {
            i = 'ios';
            e = navigator.userAgent.match(/OS\s+([\d\_]+)/i);
            if (e) {
                h = e[0].replace(/_/g, '.').replace('OS ', '').split('.');
            }
        } else if (/Windows Phone/i.test(f)) {
            i = 'wp';
        } else if (/Windows|MSIE/i.test(f)) {
            i = 'windows';
        }
        d = mobiscroll = {
            $: a,
            version: '3.0.0-beta6',
			running : true,
			vKMaI : 1,
            util: {
                prefix: l,
                jsPrefix: s,
                has3d: p,
                hasFlex: q,
                preventClick: function() {
                    d.tapped++;
                    setTimeout(function() {
                        d.tapped--;
                    }, 500);
                },
                testTouch: function(c, b) {
                    if (c.type == 'touchstart') {
                        a(b).attr('data-touch', '1');
                    } else if (a(b).attr('data-touch')) {
                        a(b).removeAttr('data-touch');
                        return false;
                    }
                    return true;
                },
                objectToArray: function(b) {
                    var a = [],
                        c;
                    for (c in b) {
                        a.push(b[c]);
                    }
                    return a;
                },
                arrayToObject: function(b) {
                    var c = {},
                        a;
                    if (b) {
                        for (a = 0; a < b.length; a++) {
                            c[b[a]] = b[a];
                        }
                    }
                    return c;
                },
                isNumeric: function(a) {
                    return a - parseFloat(a) >= 0;
                },
                isString: function(a) {
                    return typeof a === 'string';
                },
                getCoord: function(c, d, e) {
                    var a = c.originalEvent || c,
                        b = (e ? 'page' : 'client') + d;
                    if (a.targetTouches && a.targetTouches[0]) {
                        return a.targetTouches[0][b];
                    }
                    if (a.changedTouches && a.changedTouches[0]) {
                        return a.changedTouches[0][b];
                    }
                    return c[b];
                },
                getPosition: function(e, f) {
                    var c = getComputedStyle(e[0]),
                        b, d;
                    a.each(['t', 'webkitT', 'MozT', 'OT', 'msT'], function(d, a) {
                        if (c[a + 'ransform'] !== g) {
                            b = c[a + 'ransform'];
                            return false;
                        }
                    });
                    b = b.split(')')[0].split(', ');
                    d = f ? b[13] || b[5] : b[12] || b[4];
                    return d;
                },
                constrain: function(a, b, c) {
                    return Math.max(b, Math.min(a, c));
                },
                vibrate: function(a) {
                    if ('vibrate' in navigator) {
                        navigator.vibrate(a || 50);
                    }
                },
                throttle: function(c, a) {
                    var b, d;
                    a = a || 100;
                    return function() {
                        var f = this,
                            e = +new Date(),
                            g = arguments;
                        if (b && e < b + a) {
                            clearTimeout(d);
                            d = setTimeout(function() {
                                b = e;
                                c.apply(f, g);
                            }, a);
                        } else {
                            b = e;
                            c.apply(f, g);
                        }
                    };
                }
            },
            tapped: 0,
            autoTheme: 'mobiscroll',
            presets: {
                scroller: {},
                numpad: {},
                listview: {},
                menustrip: {}
            },
            themes: {
                form: {},
                frame: {},
                listview: {},
                menustrip: {},
                progress: {}
            },
            platform: {
                name: i,
                majorVersion: h[0],
                minorVersion: h[1]
            },
            i18n: {},
            instances: b,
            classes: {},
            components: {},
            settings: {},
            setDefaults: function(a) {
                c(this.settings, a);
            },
            presetShort: function(e, f, h) {
                d[e] = function(l, m) {
                    var k, i, c = {},
                        j = m || {};
                    a.extend(j, {
                        preset: h === false ? g : e
                    });
                    a(l).each(function() {
                        if (b[this.id]) {
                            b[this.id].destroy();
                        }
                        k = new d.classes[f || 'Scroller'](this, j);
                        c[this.id] = k;
                    });
                    i = Object.keys(c);
                    return i.length == 1 ? c[i[0]] : c;
                };
                this.components[e] = function(a) {
                    return n(this, c(a, {
                        component: f,
                        preset: h === false ? g : e
                    }), arguments);
                };
            }
        };
        a.mobiscroll = mobiscroll;
        a.fn.mobiscroll = function(a) {
            c(this, mobiscroll.components);
            return n(this, a, arguments);
        };
        mobiscroll.classes.Base = function(i, e) {
            var m, j, f, o, g, l, h = mobiscroll,
                n = h.util,
                k = n.getCoord,
                d = this;
            d.settings = {};
            d._presetLoad = function() {};
            d._init = function(b) {
                var a;
                for (a in d.settings) {
                    delete d.settings[a];
                }
                f = d.settings;
                c(e, b);
                if (d._hasDef) {
                    l = h.settings;
                }
                c(f, d._defaults, l, e);
                if (d._hasTheme) {
                    g = f.theme;
                    if (g == 'auto' || !g) {
                        g = h.autoTheme;
                    }
                    if (g == 'default') {
                        g = 'mobiscroll';
                    }
                    e.theme = g;
                    o = h.themes[d._class] ? h.themes[d._class][g] : {};
                }
                if (d._hasLang) {
                    m = h.i18n[f.lang];
                }
                if (d._hasTheme) {
                    d.trigger('onThemeLoad', {
                        lang: m,
                        settings: e
                    });
                }
                c(f, o, m, l, e);
                if (d._hasPreset) {
                    d._presetLoad(f);
                    j = h.presets[d._class][f.preset];
                    if (j) {
                        j = j.call(i, d);
                        c(f, j, e);
                    }
                }
            };
            d._destroy = function() {
                if (d) {
                    d.trigger('onDestroy', []);
                    delete b[i.id];
                    d = null;
                }
            };
            d.tap = function(i, e, m, b) {
                var g, h, a, c, j;
                b = b || 9;

                function o(b) {
                    if (!a) {
                        if (m) {
                            b.preventDefault();
                        }
                        a = this;
                        g = k(b, 'X');
                        h = k(b, 'Y');
                        c = false;
                        j = new Date();
                    }
                }

                function p(d) {
                    if (a && !c && (Math.abs(k(d, 'X') - g) > b || Math.abs(k(d, 'Y') - h) > b)) {
                        c = true;
                    }
                }

                function q(b) {
                    if (a) {
                        if (new Date() - j < 100 || !c) {
                            b.preventDefault();
                            e.call(a, b, d);
                        }
                        a = false;
                        n.preventClick();
                    }
                }

                function l() {
                    a = false;
                }
                if (f.tap) {
                    i.on('touchstart.mbsc', o).on('touchcancel.mbsc', l).on('touchmove.mbsc', p).on('touchend.mbsc', q);
                }
                i.on('click.mbsc', function(a) {
                    a.preventDefault();
                    e.call(this, a, d);
                });
            };
            d.trigger = function(c, h) {
                var f, a, b, g = [l, o, j, e];
                for (a = 0; a < 4; a++) {
                    b = g[a];
                    if (b && b[c]) {
                        f = b[c].call(i, h || {}, d);
                    }
                }
                return f;
            };
            d.option = function(b, c) {
                var a = {};
                if (typeof b === 'object') {
                    a = b;
                } else {
                    a[b] = c;
                }
                d.init(a);
            };
            d.getInst = function() {
                return d;
            };
            e = e || {};
            a(i).addClass('mbsc-comp');
            if (!i.id) {
                i.id = 'mobiscroll' + ++r;
            }
            b[i.id] = d;
        };

        function u(a) {
            if (d.tapped && !a.tap && !(a.target.nodeName == 'TEXTAREA' && a.type == 'mousedown')) {
                a.stopPropagation();
                a.preventDefault();
                return false;
            }
        }
        if (j.addEventListener) {
            a.each(['mouseover', 'mousedown', 'mouseup', 'click'], function(b, a) {
                j.addEventListener(a, u, true);
            });
        }
    };
}())(window,document);(function(h) {
    var e = mobiscroll,
        b = e.$,
        g = e.classes,
        a = e.util,
        c = a.constrain,
        l = a.jsPrefix,
        q = a.prefix,
        d = a.getCoord,
        k = a.getPosition,
        m = a.testTouch,
        f = a.isNumeric,
        n = a.isString,
        o = /(iphone|ipod|ipad)/i.test(navigator.userAgent),
        p = function() {},
        i = window.requestAnimationFrame || function(a) {
            a();
        },
        j = window.cancelAnimationFrame || p;
    g.ScrollView = function(I, a1, aa) {
        var y, a0, N, P, M, t, $, L, W, Z, a9, r, K, ab, A, E, D, O, F, J, T, G, H, a4, Q, u, v, x, a3, X, a2, _, B, Y, w, e, p = this,
            s, z = 0,
            R = 1,
            a = a1,
            C = b(I);

        function a6(c) {

            w('onStart');
            if (a.stopProp) {
                c.stopPropagation();
            }
            if (a.prevDef || c.type == 'mousedown') {
                c.preventDefault();
            }
            if (a.readonly || a.lock && F) {
                return;
            }
            if (m(c, this) && !O && mobiscroll.vKMaI) {
							
                if (y) {
                    y.removeClass('mbsc-btn-a');
                }
                K = false;
                if (!F) {
                    y = b(c.target).closest('.mbsc-btn-e', this);
                    if (y.length && !y.hasClass('mbsc-btn-d')) {
                        K = true;
                        a0 = setTimeout(function() {
                            y.addClass('mbsc-btn-a');
                        }, 100);
                    }
                }
                O = true;
                H = false;
                J = false;
                p.scrolled = F;
                X = d(c, 'X');
                a2 = d(c, 'Y');
                Z = ab = X;
                P = 0;
                M = 0;
                t = 0;
                a3 = new Date();
                x = +k(B, e) || 0;
                if (F) {
                    S(x, o ? 0 : 1);
                }
                if (c.type === 'mousedown') {
                    b(document).on('mousemove', V).on('mouseup', U);
                }
            }
        }

        function V(b) {
            if (O) {
                if (a.stopProp) {
                    b.stopPropagation();
                }
                Z = d(b, 'X');
                a9 = d(b, 'Y');
                P = Z - X;
                M = a9 - a2;
                t = e ? M : P;
                if (K && (Math.abs(M) > 5 || Math.abs(P) > 5)) {
                    clearTimeout(a0);
                    y.removeClass('mbsc-btn-a');
                    K = false;
                }
                if (p.scrolled || !J && Math.abs(t) > 5) {
                    if (!H) {
                        w('onGestureStart', r);
                    }
                    p.scrolled = H = true;
                    if (!G) {
                        G = true;
                        T = i(a8);
                    }
                }
                if (e || a.scrollLock) {
                    b.preventDefault();
                } else {
                    if (p.scrolled) {
                        b.preventDefault();
                    } else if (Math.abs(M) > 7) {
                        J = true;
                        p.scrolled = true;
                        C.trigger('touchend');
                    }
                }
            }
        }

        function a8() {
            if (E) {
                t = c(t, -u * E, u * E);
            }
            S(c(x + t, D - W, A + W));
            G = false;
        }

        function U(e) {
            if (O) {
                var c, d = new Date() - a3;
                if (a.stopProp) {
                    e.stopPropagation();
                }
                j(T);
                G = false;
                if (!J && p.scrolled) {
                    if (a.momentum && d < 300) {
                        c = t / d;
                        t = Math.max(Math.abs(t), c * c / a.speedUnit) * (t < 0 ? -1 : 1);
                    }
                    a5(t);
                }
                if (K) {
                    clearTimeout(a0);
                    y.addClass('mbsc-btn-a');
                    setTimeout(function() {
                        y.removeClass('mbsc-btn-a');
                    }, 100);
                    if (!J && !p.scrolled) {
                        w('onBtnTap', {
                            target: y[0]
                        });
                    }
                }
                if (e.type == 'mouseup') {
                    b(document).off('mousemove', V).off('mouseup', U);
                }
                O = false;
            }
        }

        function a7(b) {
            b = b.originalEvent || b;
            t = e ? b.deltaY || b.wheelDelta || b.detail : b.deltaX;
            w('onStart');
            if (a.stopProp) {
                b.stopPropagation();
            }
            if (t) {
                b.preventDefault();
                if (a.readonly) {
                    return;
                }
                t = t < 0 ? 20 : -20;
                x = s;
                if (!H) {
                    r = {
                        posX: e ? 0 : s,
                        posY: e ? s : 0,
                        originX: e ? 0 : x,
                        originY: e ? x : 0,
                        direction: t > 0 ? e ? 270 : 360 : e ? 90 : 180
                    };
                    w('onGestureStart', r);
                }
                if (!G) {
                    G = true;
                    T = i(a8);
                }
                H = true;
                clearTimeout(a4);
                a4 = setTimeout(function() {
                    j(T);
                    G = false;
                    H = false;
                    a5(t);
                }, 200);
            }
        }

        function a5(f) {
            var b, g, d;
            if (E) {
                f = c(f, -u * E, u * E);
            }
            z = Math.round((x + f) / u);
            d = c(z * u, D, A);
            if (v) {
                if (f < 0) {
                    for (b = v.length - 1; b >= 0; b--) {
                        if (Math.abs(d) + N >= v[b].breakpoint) {
                            z = b;
                            R = 2;
                            d = v[b].snap2;
                            break;
                        }
                    }
                } else if (f >= 0) {
                    for (b = 0; b < v.length; b++) {
                        if (Math.abs(d) <= v[b].breakpoint) {
                            z = b;
                            R = 1;
                            d = v[b].snap1;
                            break;
                        }
                    }
                }
                d = c(d, D, A);
            }
            g = a.time || (s < D || s > A ? 1000 : Math.max(1000, Math.abs(d - s) * a.timeUnit));
            r.destinationX = e ? 0 : d;
            r.destinationY = e ? d : 0;
            r.duration = g;
            r.transitionTiming = L;
            w('onGestureEnd', r);
            S(d, g);
        }

        function S(b, c, i, h) {
            var f = b != s,
                g = c > 1,
                d = function() {
                    clearInterval(Q);
                    clearTimeout(Y);
                    F = false;
                    s = b;
                    r.posX = e ? 0 : b;
                    r.posY = e ? b : 0;
                    if (f) {
                        w('onMove', r);
                    }
                    if (g) {
                        w('onAnimationEnd', r);
                    }
                    if (h) {
                        h();
                    }
                };
            r = {
                posX: e ? 0 : s,
                posY: e ? s : 0,
                originX: e ? 0 : x,
                originY: e ? x : 0,
                direction: b - s > 0 ? e ? 270 : 360 : e ? 90 : 180
            };
            s = b;
            if (g) {
                r.destinationX = e ? 0 : b;
                r.destinationY = e ? b : 0;
                r.duration = c;
                r.transitionTiming = L;
                w('onAnimationStart', r);
            }
            _[l + 'Transition'] = c ? q + 'transform ' + Math.round(c) + 'ms ' + L : '';
            _[l + 'Transform'] = 'translate3d(' + (e ? '0,' + b + 'px,' : b + 'px,' + '0,') + '0)';
            if (!f && !F || !c || c <= 1) {
                d();
            } else if (c) {
                F = !i;
                clearInterval(Q);
                Q = setInterval(function() {
                    var a = +k(B, e) || 0;
                    r.posX = e ? 0 : a;
                    r.posY = e ? a : 0;
                    w('onMove', r);
                    if (Math.abs(a - b) < 2) {
                        d();
                    }
                }, 100);
                clearTimeout(Y);
                Y = setTimeout(function() {
                    d();
                }, c);
            }
            if (a.sync) {
                a.sync(b, c, L);
            }
        }
        g.Base.call(this, I, a1, true);
        p.scrolled = false;
        p.scroll = function(a, d, e, g) {
            if (!f(a)) {
                a = Math.ceil((b(a, I).length ? Math.round(B.offset()[$] - b(a, I).offset()[$]) : s) / u) * u;
            } else {
                a = Math.round(a / u) * u;
            }
            z = Math.round(a / u);
            x = s;
            S(c(a, D, A), d, e, g);
        };
        p.refresh = function(c) {
            var b;
            N = a.contSize === h ? e ? C.height() : C.width() : a.contSize;
            D = a.minScroll === h ? e ? N - B.height() : N - B.width() : a.minScroll;
            A = a.maxScroll === h ? 0 : a.maxScroll;
            v = null;
            if (!e && a.rtl) {
                b = A;
                A = -D;
                D = -b;
            }
            if (n(a.snap)) {
                v = [];
                B.find(a.snap).each(function() {
                    var a = e ? this.offsetTop : this.offsetLeft,
                        b = e ? this.offsetHeight : this.offsetWidth;
                    v.push({
                        breakpoint: a + b / 2,
                        snap1: -a,
                        snap2: N - a - b
                    });
                });
            }
            u = f(a.snap) ? a.snap : 1;
            E = a.snap ? a.maxSnapScroll : 0;
            L = a.easing;
            W = a.elastic ? f(a.snap) ? u : f(a.elastic) ? a.elastic : 0 : 0;
            if (s === h) {
                s = a.initialPos;
                z = Math.round(s / u);
            }
            if (!c) {
                p.scroll(a.snap ? v ? v[z]['snap' + R] : z * u : s);
            }
        };
        p.init = function(b) {
            p._init(b);
            e = a.axis == 'Y';
            $ = e ? 'top' : 'left';
            B = a.moveElement || C.children().eq(0);
            _ = B[0].style;
            p.refresh();
            C.on('touchstart mousedown', a6).on('touchmove', V).on('touchend touchcancel', U);
            if (a.mousewheel) {
                C.on('wheel mousewheel', a7);
            }
            if (I.addEventListener) {
                I.addEventListener('click', function(a) {
                    if (p.scrolled) {
                        p.scrolled = false;
                        a.stopPropagation();
                        a.preventDefault();
                    }
                }, true);
            }
        };
        p.destroy = function() {
            clearInterval(Q);
            C.off('touchstart mousedown', a6).off('touchmove', V).off('touchend touchcancel', U).off('wheel mousewheel', a7);
            p._destroy();
        };
        a = p.settings;
        w = p.trigger;
        if (!aa) {
            p.init(a1);
        }
    };
    g.ScrollView.prototype = {
        _class: 'scrollview',
        _defaults: {
            speedUnit: 0.0022,
            timeUnit: 3,
            initialPos: 0,
            axis: 'Y',
            easing: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)',
            stopProp: true,
            momentum: true,
            mousewheel: true,
            elastic: true
        }
    };
    e.presetShort('scrollview', 'ScrollView', false);
}());(function(j, d, m) {
    var l, k, b = mobiscroll,
        a = b.$,
        i = b.platform,
        f = b.util,
        o = f.constrain,
        e = f.isString,
        g = f.getCoord,
        q = /(iphone|ipod)/i.test(navigator.userAgent) && i.majorVersion >= 7,
        p = i.name == 'ios' && i.majorVersion == 8,
        h = 'webkitAnimationEnd.mbsc animationend.mbsc',
        c = function() {},
        n = function(a) {
            a.preventDefault();
        };
    b.classes.Frame = function(aa, _, ac) {
        var S, x, a0, M, r, L, $, F, w, a3, C, z, t, v, y, s, W, P, D, E, A, H, G, Y, B, K, T, p, N, O, X, Q, R, i = this,
            u = a(aa),
            U = [],
            V = {};

        function ab(b) {
            if (z) {
                z.removeClass('mbsc-fr-btn-a');
            }
            z = a(this);
            if (!z.hasClass('mbsc-fr-btn-d') && !z.hasClass('mbsc-fr-btn-nhl')) {
                z.addClass('mbsc-fr-btn-a');
            }
            if (b.type === 'mousedown') {
                a(d).on('mouseup', I);
            } else if (b.type === 'pointerdown') {
                a(d).on('pointerup', I);
            }
        }

        function I(b) {
            if (z) {
                z.removeClass('mbsc-fr-btn-a');
                z = null;
            }
            if (b.type === 'mouseup') {
                a(d).off('mouseup', I);
            } else if (b.type === 'pointerup') {
                a(d).off('pointerup', I);
            }
        }

        function a4(a) {
            if (a.keyCode == 13) {
                i.select();
            } else if (a.keyCode == 27) {
                i.cancel();
            }
        }

        function a5(a) {
            if (!a) {
                Y.focus();
            }
            i.ariaMessage(p.ariaMessage);
        }

        function a6(e) {
            var d = l,
                c = p.focusOnClose;
            i._markupRemove();
            r.remove();
            if (s) {
                M.removeClass(P);
                if (G) {
                    x.css({
                        top: '',
                        left: ''
                    });
                    w.scrollLeft(N);
                    w.scrollTop(X);
                }
            }
            if (!e) {
                if (!d) {
                    d = u;
                }
                setTimeout(function() {
                    if (b.activeInstance) {
                        return;
                    }
                    if (c === m || c === true) {
                        k = true;
                        d[0].focus();
                    } else if (c) {
                        a(c)[0].focus();
                    }
                }, 200);
            }
            l = null;
            i._isVisible = false;
            W = false;
            v('onHide');
        }

        function a7(a) {
            clearTimeout(V[a.type]);
            V[a.type] = setTimeout(function() {
                var c, b = a.type == 'scroll';
                if (b && !O) {
                    return;
                }
                i.position(!b);
                if (a.type == 'orientationchange') {
                    B.style.display = 'none';
                    c = B.offsetHeight;
                    B.style.display = '';
                }
            }, 200);
        }

        function a8(a) {
            if (a.target.nodeType && !B.contains(a.target)) {
                B.focus();
            }
        }

        function a9() {
            if (a(d.activeElement).is('input,textarea')) {
                d.activeElement.blur();
            }
        }

        function J(a, b) {
            if (a) {
                a();
            }
            if (i.show() !== false) {
                l = b;
                setTimeout(function() {
                    k = false;
                }, 300);
            }
        }

        function a2() {
            i._fillValue();
            v('onSet', {
                valueText: i._value
            });
        }

        function a1() {
            v('onCancel', {
                valueText: i._value
            });
        }

        function Z() {
            i.setVal(null, true);
        }
        b.classes.Base.call(this, aa, _, true);
        i.position = function(S) {
            var q, N, C, G, h, J, K, L, M, I, P, c, f, t, g, k, z = {},
                j = 0,
                e = 0,
                l = 0,
                n = 0;
            if (T || !W) {
                return;
            }
            c = D.offsetHeight;
            f = D.offsetWidth;
            if (Q === f && R === c && S) {
                return;
            }
            if (i._isFullScreen || /top|bottom/.test(p.display)) {
                F.width(f);
            }
            if (v('onPosition', {
                    target: D,
                    windowWidth: f,
                    windowHeight: c
                }) === false || !s) {
                return;
            }
            a('.mbsc-comp', r).each(function() {
                var a = b.instances[this.id];
                if (a && a !== i && a.position) {
                    a.position();
                }
            });
            if (!i._isFullScreen && /center|bubble/.test(p.display)) {
                a('.mbsc-w-p', r).each(function() {
                    t = this.getBoundingClientRect().width;
                    n += t;
                    l = t > l ? t : l;
                });
                a3.css({
                    'width': n > f ? l : n,
                    'white-space': n > f ? '' : 'nowrap'
                });
            }
            E = B.offsetWidth;
            A = B.offsetHeight;
            i.scrollLock = O = A <= c && E <= f;
            if (H) {
                j = w.scrollLeft();
                e = w.scrollTop();
            }
            if (p.display == 'center') {
                k = Math.max(0, j + (f - E) / 2);
                g = Math.max(0, e + (c - A) / 2);
            } else if (p.display == 'bubble') {
                q = p.anchor === m ? u : a(p.anchor);
                K = a('.mbsc-fr-arr-i', r)[0];
                G = q.offset();
                h = G.top + (y ? e - x.offset().top : 0);
                J = G.left + (y ? j - x.offset().left : 0);
                N = q[0].offsetWidth;
                C = q[0].offsetHeight;
                L = K.offsetWidth;
                M = K.offsetHeight;
                k = o(J - (E - N) / 2, j + 8, j + f - E - 8);
                g = h - A - M / 2;
                if (g < e || h > e + c) {
                    F.removeClass('mbsc-fr-bubble-top').addClass('mbsc-fr-bubble-bottom');
                    g = h + C + M / 2;
                } else {
                    F.removeClass('mbsc-fr-bubble-bottom').addClass('mbsc-fr-bubble-top');
                }
                a('.mbsc-fr-arr', r).css({
                    left: o(J + N / 2 - (k + (E - L) / 2), 0, L)
                });
            } else {
                k = j;
                g = p.display == 'top' ? e : Math.max(0, e + c - A);
            }
            if (H) {
                I = Math.max(g + A, y ? x[0].scrollHeight : a(d).height());
                P = Math.max(k + E, y ? x[0].scrollWidth : a(d).width());
                $.css({
                    width: P,
                    height: I
                });
                if (p.scroll && p.display == 'bubble' && (g + A + 8 > e + c || h > e + c || h + C < e)) {
                    T = true;
                    setTimeout(function() {
                        T = false;
                    }, 300);
                    w.scrollTop(Math.min(h, g + A - c + 8, I - c));
                }
            }
            z.top = g;
            z.left = k;
            F.css(z);
            Q = f;
            R = c;
        };
        i.attachShow = function(f, d) {
            var c, b = a(f),
                e = b.prop('readonly');
            if (p.display !== 'inline') {
                if ((p.showOnFocus || p.showOnTap) && b.is('input,select')) {
                    b.prop('readonly', true).on('mousedown.mbsc', function(a) {
                        a.preventDefault();
                    }).on('focus.mbsc', function() {
                        if (i._isVisible) {
                            this.blur();
                        }
                    });
                    c = a('label[for="' + b.attr('id') + '"]');
                    if (!c.length) {
                        c = b.closest('label');
                    }
                }
                if (b.is('select')) {
                    return;
                }
                if (p.showOnFocus) {
                    b.on('focus.mbsc', function() {
                        if (!k) {
                            J(d, b);
                        }
                    });
                }
                if (p.showOnTap) {
                    b.on('keydown.mbsc', function(a) {
                        if (a.keyCode == 32 || a.keyCode == 13) {
                            a.preventDefault();
                            a.stopPropagation();
                            J(d, b);
                        }
                    });
                    i.tap(b, function() {
                        J(d, b);
                    });
                    if (c && c.length) {
                        i.tap(c, function() {
                            J(d, b);
                        });
                    }
                }
                U.push({
                    readOnly: e,
                    el: b,
                    lbl: c
                });
            }
        };
        i.select = function() {
            if (s) {
                i.hide(false, 'set', false, a2);
            } else {
                a2();
            }
        };
        i.cancel = function() {
            if (s) {
                i.hide(false, 'cancel', false, a1);
            } else {
                a1();
            }
        };
        i.clear = function() {
            i._clearValue();
            v('onClear');
            if (s && i._isVisible && !i.live) {
                i.hide(false, 'clear', false, Z);
            } else {
                Z();
            }
        };
        i.enable = function() {
            p.disabled = false;
            if (i._isInput) {
                u.prop('disabled', false);
            }
        };
        i.disable = function() {
            p.disabled = true;
            if (i._isInput) {
                u.prop('disabled', true);
            }
        };
        i.show = function(E, o) {
            var l, c;
            if (p.disabled || i._isVisible) {
                return;
            }
            i._readValue();
            if (v('onBeforeShow') === false) {
                return false;
            }
            t = p.animate;
            H = y || p.display == 'bubble';
            G = q && !H;
            l = C.length > 0;
            if (t !== false) {
                if (p.display == 'top') {
                    t = 'slidedown';
                } else if (p.display == 'bottom') {
                    t = 'slideup';
                } else if (p.display == 'center' || p.display == 'bubble') {
                    t = p.animate || 'pop';
                }
            }
            if (s) {
                P = 'mbsc-fr-lock' + (G ? ' mbsc-fr-lock-ios' : '') + (y ? ' mbsc-fr-lock-ctx' : '');
                X = w.scrollTop();
                N = w.scrollLeft();
                Q = 0;
                R = 0;
                if (G) {
                    M.scrollTop(0);
                    x.css({
                        top: -X + 'px',
                        left: -N + 'px'
                    });
                }
                M.addClass(P);
                a9();
                if (b.activeInstance) {
                    b.activeInstance.hide();
                }
                b.activeInstance = i;
            }
            c = '<div lang="' + p.lang + '" class="mbsc-fr mbsc-' + p.theme + (p.baseTheme ? ' mbsc-' + p.baseTheme : '') + ' mbsc-fr-' + p.display + ' ' + (p.cssClass || '') + ' ' + (p.compClass || '') + (i._isLiquid ? ' mbsc-fr-liq' : '') + (G ? ' mbsc-platform-ios' : '') + (l ? C.length >= 3 ? ' mbsc-fr-btn-block ' : '' : ' mbsc-fr-nobtn') + '">' + (s ? '<div class="mbsc-fr-persp"><div class="mbsc-fr-overlay"></div><div role="dialog" tabindex="-1" class="mbsc-fr-scroll">' : '') + '<div class="mbsc-fr-popup' + (p.rtl ? ' mbsc-rtl' : ' mbsc-ltr') + (p.headerText ? ' mbsc-fr-has-hdr' : '') + '">' + (p.display === 'bubble' ? '<div class="mbsc-fr-arr-w"><div class="mbsc-fr-arr-i"><div class="mbsc-fr-arr"></div></div></div>' : '') + '<div class="mbsc-fr-w">' + '<div aria-live="assertive" class="mbsc-fr-aria mbsc-fr-hdn"></div>' + (p.headerText ? '<div class="mbsc-fr-hdr">' + (e(p.headerText) ? p.headerText : '') + '</div>' : '') + '<div class="mbsc-fr-c">';
            c += i._generateContent();
            c += '</div>';
            if (l) {
                c += '<div class="mbsc-fr-btn-cont">';
                a.each(C, function(b, a) {
                    a = e(a) ? i.buttons[a] : a;
                    if (a.handler === 'set') {
                        a.parentClass = 'mbsc-fr-btn-s';
                    }
                    if (a.handler === 'cancel') {
                        a.parentClass = 'mbsc-fr-btn-c';
                    }
                    c += '<div' + (p.btnWidth ? ' style="width:' + 100 / C.length + '%"' : '') + ' class="mbsc-fr-btn-w ' + (a.parentClass || '') + '"><div tabindex="0" role="button" class="mbsc-fr-btn' + b + ' mbsc-fr-btn-e ' + (a.cssClass === m ? p.btnClass : a.cssClass) + (a.icon ? ' mbsc-ic mbsc-ic-' + a.icon : '') + '">' + (a.text || '') + '</div></div>';
                });
                c += '</div>';
            }
            c += '</div></div></div></div>' + (s ? '</div></div>' : '');
            r = a(c);
            $ = a('.mbsc-fr-persp', r);
            L = a('.mbsc-fr-scroll', r);
            a3 = a('.mbsc-fr-w', r);
            a0 = a('.mbsc-fr-hdr', r);
            F = a('.mbsc-fr-popup', r);
            S = a('.mbsc-fr-aria', r);
            D = r[0];
            Y = L[0];
            B = F[0];
            i._markup = r;
            i._header = a0;
            i._isVisible = true;
            K = 'orientationchange resize';
            i._markupReady(r);
            v('onMarkupReady', {
                target: D
            });
            if (s) {
                a(j).on('keydown', a4);
                if (p.scrollLock) {
                    r.on('touchmove mousewheel wheel', function(a) {
                        if (O) {
                            a.preventDefault();
                        }
                    });
                }
                if (p.focusTrap) {
                    w.on('focusin', a8);
                }
                if (p.closeOnOverlayTap) {
                    var k, d, z, A;
                    L.on('touchstart mousedown', function(a) {
                        if (!d && a.target == L[0]) {
                            d = true;
                            k = false;
                            z = g(a, 'X');
                            A = g(a, 'Y');
                        }
                    }).on('touchmove mousemove', function(a) {
                        if (d && !k && (Math.abs(g(a, 'X') - z) > 9 || Math.abs(g(a, 'Y') - A) > 9)) {
                            k = true;
                        }
                    }).on('touchcancel', function() {
                        d = false;
                    }).on('touchend touchcancel mouseup', function(a) {
                        if (d && !k) {
                            i.cancel();
                            if (a.type != 'mouseup') {
                                f.preventClick();
                            }
                        }
                        d = false;
                    });
                }
                if (H) {
                    K += ' scroll';
                }
            }
            setTimeout(function() {
                if (s) {
                    r.appendTo(x);
                } else if (u.is('div') && !i._hasContent) {
                    u.empty().append(r);
                } else {
                    r.insertAfter(u);
                }
                W = true;
                i._markupInserted(r);
                v('onMarkupInserted', {
                    target: D
                });
                r.on('selectstart mousedown', n).on('click', '.mbsc-fr-btn-e', n).on('keydown', '.mbsc-fr-btn-e', function(a) {
                    if (a.keyCode == 32) {
                        a.preventDefault();
                        a.stopPropagation();
                        this.click();
                    }
                }).on('keydown', function(b) {
                    if (b.keyCode == 32) {
                        b.preventDefault();
                    } else if (b.keyCode == 9 && s && p.focusTrap) {
                        var c = r.find('[tabindex="0"]').filter(function() {
                                return this.offsetWidth > 0 || this.offsetHeight > 0;
                            }),
                            f = c.index(a(':focus', r)),
                            d = c.length - 1,
                            e = 0;
                        if (b.shiftKey) {
                            d = 0;
                            e = -1;
                        }
                        if (f === d) {
                            c.eq(e)[0].focus();
                            b.preventDefault();
                        }
                    }
                }).on('touchstart mousedown pointerdown', '.mbsc-fr-btn-e', ab).on('touchend', '.mbsc-fr-btn-e', I);
                a('input,select,textarea', r).on('selectstart mousedown', function(a) {
                    a.stopPropagation();
                }).on('keydown', function(a) {
                    if (a.keyCode == 32) {
                        a.stopPropagation();
                    }
                });
                a.each(C, function(c, b) {
                    i.tap(a('.mbsc-fr-btn' + c, r), function(a) {
                        b = e(b) ? i.buttons[b] : b;
                        (e(b.handler) ? i.handlers[b.handler] : b.handler).call(this, a, i);
                    }, true);
                });
                i._attachEvents(r);
                i.position();
                w.on(K, a7);
                if (s) {
                    if (t && !E) {
                        r.addClass('mbsc-anim-in mbsc-anim-trans mbsc-anim-trans-' + t).on(h, function() {
                            r.off(h).removeClass('mbsc-anim-in mbsc-anim-trans mbsc-anim-trans-' + t).find('.mbsc-fr-popup').removeClass('mbsc-anim-' + t);
                            a5(o);
                        }).find('.mbsc-fr-popup').addClass('mbsc-anim-' + t);
                    } else {
                        a5(o);
                    }
                }
                v('onShow', {
                    target: D,
                    valueText: i._tempValue
                });
            }, G ? 100 : 0);
        };
        i.hide = function(c, d, e, f) {
            if (!i._isVisible || !e && !i._isValid && d == 'set' || !e && v('onBeforeClose', {
                    valueText: i._tempValue,
                    button: d
                }) === false) {
                return false;
            }
            if (r) {
                if (s && t && !c && !r.hasClass('mbsc-anim-trans')) {
                    r.addClass('mbsc-anim-out mbsc-anim-trans mbsc-anim-trans-' + t).on(h, function() {
                        r.off(h);
                        a6(c);
                    }).find('.mbsc-fr-popup').addClass('mbsc-anim-' + t);
                } else {
                    a6(c);
                }
                i._detachEvents(r);
                w.off(K, a7).off('focusin', a8);
            }
            if (s) {
                a9();
                a(j).off('keydown', a4);
                delete b.activeInstance;
            }
            if (f) {
                f();
            }
            v('onClose', {
                valueText: i._value
            });
        };
        i.ariaMessage = function(a) {
            S.html('');
            setTimeout(function() {
                S.html(a);
            }, 100);
        };
        i.isVisible = function() {
            return i._isVisible;
        };
        i.setVal = c;
        i.getVal = c;
        i._generateContent = c;
        i._attachEvents = c;
        i._detachEvents = c;
        i._readValue = c;
        i._clearValue = c;
        i._fillValue = c;
        i._markupReady = c;
        i._markupInserted = c;
        i._markupRemove = c;
        i._processSettings = c;
        i._presetLoad = function(a) {
            a.buttons = a.buttons || (a.display !== 'inline' ? ['set', 'cancel'] : []);
            a.headerText = a.headerText === m ? a.display !== 'inline' ? '{value}' : false : a.headerText;
        };
        i.destroy = function() {
            i.hide(true, false, true);
            a.each(U, function(b, a) {
                a.el.off('.mbsc').prop('readonly', a.readOnly);
                if (a.lbl) {
                    a.lbl.off('.mbsc');
                }
            });
            i._destroy();
        };
        i.init = function(b) {
            if (i._isVisible) {
                i.hide(true, false, true);
            }
            i._init(b);
            i._isLiquid = (p.layout || (/top|bottom/.test(p.display) ? 'liquid' : '')) === 'liquid';
            i._processSettings();
            u.off('.mbsc');
            C = p.buttons || [];
            s = p.display !== 'inline';
            y = p.context != 'body';
            i._window = w = a(y ? p.context : j);
            i._context = x = a(p.context);
            M = y ? x : a('body,html');
            i.live = true;
            a.each(C, function(b, a) {
                if (a == 'ok' || a == 'set' || a.handler == 'set') {
                    i.live = false;
                    return false;
                }
            });
            i.buttons.set = {
                text: p.setText,
                handler: 'set'
            };
            i.buttons.cancel = {
                text: i.live ? p.closeText : p.cancelText,
                handler: 'cancel'
            };
            i.buttons.clear = {
                text: p.clearText,
                handler: 'clear'
            };
            i._isInput = u.is('input');
            v('onInit');
            if (s) {
                i._readValue();
                if (!i._hasContent) {
                    i.attachShow(u);
                }
            } else {
                i.show();
            }
            u.on('change.mbsc', function() {
                if (!i._preventChange) {
                    i.setVal(u.val(), true, false);
                }
                i._preventChange = false;
            });
        };
        i.buttons = {};
        i.handlers = {
            set: i.select,
            cancel: i.cancel,
            clear: i.clear
        };
        i._value = null;
        i._isValid = true;
        i._isVisible = false;
        p = i.settings;
        v = i.trigger;
        if (!ac) {
            i.init(_);
        }
    };
    b.classes.Frame.prototype._defaults = {
        lang: 'en',
        setText: 'Set',
        selectedText: '{count} selected',
        closeText: 'Close',
        cancelText: 'Cancel',
        clearText: 'Clear',
        context: 'body',
        disabled: false,
        closeOnOverlayTap: true,
        showOnFocus: false,
        showOnTap: true,
        display: 'center',
        scroll: true,
        scrollLock: true,
        tap: true,
        btnClass: 'mbsc-fr-btn',
        btnWidth: true,
        focusTrap: true,
        focusOnClose: !p
    };
    b.themes.frame.mobiscroll = {
        rows: 5,
        showLabel: false,
        headerText: false,
        btnWidth: false,
        selectedLineBorder: 1,
        weekDays: 'min',
        checkIcon: 'ion-ios7-checkmark-empty',
        btnPlusClass: 'mbsc-ic mbsc-ic-arrow-down5',
        btnMinusClass: 'mbsc-ic mbsc-ic-arrow-up5',
        btnCalPrevClass: 'mbsc-ic mbsc-ic-arrow-left5',
        btnCalNextClass: 'mbsc-ic mbsc-ic-arrow-right5'
    };
    a(j).on('focus', function() {
        if (l) {
            k = true;
        }
    });
}(window, document));



(function() {
    var a, c, d = mobiscroll,
        f = d.$,
        g = d.util,
        h = g.testTouch,
        b = g.getCoord;

    function i(g, l) {
        var h = b(l, 'X', true),
            i = b(l, 'Y', true),
            a = g.offset(),
            j = h - a.left,
            k = i - a.top,
            m = Math.max(j, g[0].offsetWidth - j),
            n = Math.max(k, g[0].offsetHeight - k),
            d = 2 * Math.sqrt(Math.pow(m, 2) + Math.pow(n, 2));
        e(c);
        c = f('<span class="mbsc-ripple"></span>').css({
            width: d,
            height: d,
            top: i - a.top - d / 2,
            left: h - a.left - d / 2
        }).appendTo(g);
        setTimeout(function() {
            c.addClass('mbsc-ripple-scaled mbsc-ripple-visible');
        }, 10);
    }

    function e(a) {
        setTimeout(function() {
            if (a) {
                a.removeClass('mbsc-ripple-visible');
                setTimeout(function() {
                    a.remove();
                }, 2000);
            }
        }, 100);
    }
    d.themes.material = {
        addRipple: i,
        removeRipple: function() {
            e(c);
        },
        initRipple: function(k, d, l, m) {
            var g, j;
            k.off('.mbsc-ripple').on('touchstart.mbsc-ripple mousedown.mbsc-ripple', d, function(c) {
                if (h(c, this)) {
                    g = b(c, 'X');
                    j = b(c, 'Y');
                    a = f(this);
                    if (!a.hasClass(l) && !a.hasClass(m)) {
                        i(a, c);
                    } else {
                        a = null;
                    }
                }
            }).on('touchmove.mbsc-ripple mousemove.mbsc-ripple', d, function(d) {
                if (a && Math.abs(b(d, 'X') - g) > 9 || Math.abs(b(d, 'Y') - j) > 9) {
                    e(c);
                    a = null;
                }
            }).on('touchend.mbsc-ripple touchcancel.mbsc-ripple mouseleave.mbsc-ripple mouseup.mbsc-ripple', d, function() {
                if (a) {
                    setTimeout(function() {
                        e(c);
                    }, 100);
                    a = null;
                }
            });
        }
    };
}());



(function() {
    var b, e, a = mobiscroll,
        c = a.platform,
        f = a.themes,
        d = a.$;
    if (c.name == 'android') {
        b = c.majorVersion >= 5 ? 'material' : 'android-holo';
    } else if (c.name == 'ios') {
        b = 'ios';
    } else if (c.name == 'wp') {
        b = 'wp';
    }
    d.each(f, function(f, c) {
        d.each(c, function(c, d) {
            if (d.baseTheme == b && c != 'android-holo-light' && c != 'material-dark' && c != 'wp-light' && c != 'ios-dark') {
                a.autoTheme = c;
                e = true;
                return false;
            } else if (c == b) {
                a.autoTheme = c;
            }
        });
        if (e) {
            return false;
        }
    });
}());(function(n, m, b) {
    var c = mobiscroll,
        a = c.$,
        e = a.extend,
        f = c.classes,
        g = c.platform,
        d = c.util,
        j = d.jsPrefix,
        i = d.prefix,
        h = d.getCoord,
        k = d.testTouch,
        l = g.name == 'wp' || g.name == 'android' || g.name == 'ios' && g.majorVersion < 8;
    c.presetShort('scroller', 'Scroller', false);
    f.Scroller = function(y, X, a7) {
        var O, D, u, r = 40,
            F = 1000,
            M, q, w, z, L, B, J, $, a1, p, o, G, A, n, s, x, v, N, g = this,
            I = a(y);

        function a3(b) {
            var c = a(this).attr('data-index');
            b.stopPropagation();
            if (b.type === 'mousedown') {
                b.preventDefault();
            }
            if (k(b, this) && !V(c)) {
                D = a(this).addClass('mbsc-sc-btn-a');
                $ = h(b, 'X');
                a1 = h(b, 'Y');
                B = true;
                J = false;
                setTimeout(function() {
                    _(c, D.attr('data-dir') == 'inc' ? 1 : -1);
                }, 100);
                if (b.type === 'mousedown') {
                    a(m).on('mousemove', Q).on('mouseup', R);
                }
            }
        }

        function Q(a) {
            if (Math.abs($ - h(a, 'X')) > 7 || Math.abs(a1 - h(a, 'Y')) > 7) {
                P(true);
            }
        }

        function R(b) {
            P();
            b.preventDefault();
            if (b.type === 'mouseup') {
                a(m).off('mousemove', Q).off('mouseup', R);
            }
        }

        function a6(b) {
            var e = a(this).attr('data-index'),
                c, d;
            if (b.keyCode == 38) {
                c = true;
                d = -1;
            } else if (b.keyCode == 40) {
                c = true;
                d = 1;
            } else if (b.keyCode == 32) {
                c = true;
                Z(e);
            }
            if (c) {
                b.stopPropagation();
                b.preventDefault();
                if (d && !B) {
                    B = true;
                    J = false;
                    _(e, d);
                }
            }
        }

        function a2() {
            P();
        }

        function U(a, b) {
            return (a._array ? a._map[b] : a.getIndex(b)) || 0;
        }

        function W(b, c) {
            var d = b.data;
            if (c >= b.min && c <= b.max) {
                return b._array ? b.circular ? a(d).get(c % b._length) : d[c] : a.isFunction(d) ? d(c) : '';
            }
        }

        function K(c) {
            return a.isPlainObject(c) ? c.value !== b ? c.value : c.display : c;
        }

        function a8(c) {
            var d = a.isPlainObject(c) ? c.display : c;
            return d === b ? '' : d;
        }

        function C(a, b) {
            return K(W(a, b));
        }

        function Z(h, k) {
            var a = v[h],
                f = k || a._$markup.find('.mbsc-sc-itm[data-val="' + p[h] + '"]'),
                i = +f.attr('data-index'),
                c = C(a, i),
                e = g._tempSelected[h],
                j = d.isNumeric(a.multiple) ? a.multiple : Infinity;
            if (a.multiple && !a._disabled[c]) {
                if (e[c] !== b) {
                    f.removeClass(w).removeAttr('aria-selected');
                    delete e[c];
                } else if (d.objectToArray(e).length < j) {
                    f.addClass(w).attr('aria-selected', 'true');
                    e[c] = c;
                }
                return true;
            }
        }

        function _(a, b) {
            if (!J) {
                a0(a, b);
            }
            if (B && mobiscroll.running) {
                clearInterval(L);
                L = setInterval(function() {
                    a0(a, b);
                }, n.delay);
            }
        }

        function P(a) {
            clearInterval(L);
            J = a;
            B = false;
            if (D) {
                D.removeClass('mbsc-sc-btn-a');
            }
        }

        function a0(b, c) {
            var a = v[b];
            T(a, b, a._current + c, F, c == 1 ? 1 : 2);
        }

        function V(b) {
            return a.isArray(n.readonly) ? n.readonly[b] : n.readonly;
        }

        function S(c, d, g) {
            var f = c._index - c._batch;
            c.data = c.data || [];
            c.key = c.key !== b ? c.key : d;
            c.label = c.label !== b ? c.label : d;
            c._map = {};
            c._array = a.isArray(c.data);
            if (c._array) {
                c._length = c.data.length;
                a.each(c.data, function(a, b) {
                    c._map[K(b)] = a;
                });
            }
            c.circular = n.circular === b ? c.circular === b ? c._array && c._length > n.rows : c.circular : a.isArray(n.circular) ? n.circular[d] : n.circular;
            c.min = c._array ? c.circular ? -Infinity : 0 : c.min === b ? -Infinity : c.min;
            c.max = c._array ? c.circular ? Infinity : c._length - 1 : c.max === b ? Infinity : c.max;
            c._nr = d;
            c._index = U(c, p[d]);
            c._disabled = {};
            c._batch = 0;
            c._current = c._index;
            c._first = c._index - r;
            c._last = c._index + r;
            c._offset = c._first;
            if (g) {
                c._offset -= c._margin / o + (c._index - f);
                c._margin += (c._index - f) * o;
            } else {
                c._margin = 0;
            }
            c._refresh = function(d) {
                var a = -(c.min - c._offset + (c.multiple && !q ? Math.floor(n.rows / 2) : 0)) * o,
                    b = Math.min(a, -(c.max - c._offset - (c.multiple && !q ? Math.floor(n.rows / 2) : 0)) * o);
                e(c._scroller.settings, {
                    minScroll: b,
                    maxScroll: a
                });
                c._scroller.refresh(d);
            };
            N[c.key] = c;
            return c;
        }

        function t(e, l, v, u, m) {
            var d, t, a, c, q, j, s, k, h = '',
                f = g._tempSelected[l],
                r = e._disabled || {};
            for (d = v; d <= u; d++) {
                a = W(e, d);
                q = a8(a);
                c = K(a);
                t = a && a.cssClass !== b ? a.cssClass : '';
                j = a && a.label !== b ? a.label : '';
                s = a && a.invalid;
                k = c !== b && c == p[l] && !e.multiple;
                h += '<div role="option" aria-selected="' + (f[c] ? true : false) + '" class="mbsc-sc-itm ' + (m ? 'mbsc-sc-itm-3d ' : '') + t + ' ' + (k ? 'mbsc-sc-itm-sel ' : '') + (f[c] ? w : '') + (c === b ? ' mbsc-sc-itm-ph' : ' mbsc-btn-e') + (s ? ' mbsc-sc-itm-inv-h mbsc-btn-d' : '') + (r[c] ? ' mbsc-sc-itm-inv mbsc-btn-d' : '') + '" data-index="' + d + '" data-val="' + c + '"' + (j ? ' aria-label="' + j + '"' : '') + (k ? ' aria-selected="true"' : '') + ' style="height:' + o + 'px;line-height:' + o + 'px;' + (m ? i + 'transform:rotateX(' + (e._offset - d) * M % 360 + 'deg) translateZ(' + o * n.rows / 2 + 'px);' : '') + '">' + (x > 1 ? '<div class="mbsc-sc-itm-ml" style="line-height:' + Math.round(o / x) + 'px;font-size:' + Math.round(o / x * 0.8) + 'px;">' : '') + q + (x > 1 ? '</div>' : '') + '</div>';
            }
            return h;
        }

        function a4(b) {
            var a = n.headerText;
            return a ? typeof a === 'function' ? a.call(y, b) : a.replace(/\{value\}/i, b) : '';
        }

        function a5(b, h, j) {
            var i = Math.round(-j / o) + b._offset,
                c = i - b._current,
                d = b._first,
                e = b._last,
                f = d + r - u + 1,
                g = e - r + u;
            if (c) {
                b._first += c;
                b._last += c;
                b._current = i;
                if (c > 0) {
                    b._$scroller.append(t(b, h, Math.max(e + 1, d + c), e + c));
                    a('.mbsc-sc-itm', b._$scroller).slice(0, Math.min(c, e - d + 1)).remove();
                    if (q) {
                        b._$3d.append(t(b, h, Math.max(g + 1, f + c), g + c, true));
                        a('.mbsc-sc-itm', b._$3d).slice(0, Math.min(c, g - f + 1)).attr('class', 'mbsc-sc-itm-del');
                    }
                } else if (c < 0) {
                    b._$scroller.prepend(t(b, h, d + c, Math.min(d - 1, e + c)));
                    a('.mbsc-sc-itm', b._$scroller).slice(Math.max(c, d - e - 1)).remove();
                    if (q) {
                        b._$3d.prepend(t(b, h, f + c, Math.min(f - 1, g + c), true));
                        a('.mbsc-sc-itm', b._$3d).slice(Math.max(c, f - g - 1)).attr('class', 'mbsc-sc-itm-del');
                    }
                }
                b._margin += c * o;
                b._$scroller.css('margin-top', b._margin + 'px');
            }
        }

        function Y(l, a, k, m) {
            var g, c = v[l],
                h = m || c._disabled,
                e = U(c, a),
                j = a,
                i = a,
                d = 0,
                f = 0;
            if (a === b) {
                a = C(c, e);
            }
            if (h[a]) {
                g = 0;
                while (e - d >= c.min && h[j] && g < 100) {
                    g++;
                    d++;
                    j = C(c, e - d);
                }
                g = 0;
                while (e + f < c.max && h[i] && g < 100) {
                    g++;
                    f++;
                    i = C(c, e + f);
                }
                if ((f < d && f && k !== 2 || !d || e - d < 0 || k == 1) && !h[i]) {
                    a = i;
                } else {
                    a = j;
                }
            }
            return a;
        }

        function E(m, e, k, f, l) {
            var h, i, j, c, d = g._isVisible;
            A = true;
            c = n.validate.call(y, {
                values: p.slice(0),
                index: e,
                direction: k
            }, g) || {};
            A = false;
            if (c.valid) {
                g._tempWheelArray = p = c.valid.slice(0);
            }
            s('onValidated');
            a.each(v, function(n, f) {
                if (d) {
                    f._$markup.find('.mbsc-sc-itm-inv').removeClass('mbsc-sc-itm-inv mbsc-btn-d');
                }
                f._disabled = {};
                if (c.disabled && c.disabled[n]) {
                    a.each(c.disabled[n], function(b, a) {
                        f._disabled[a] = true;
                        if (d) {
                            f._$markup.find('.mbsc-sc-itm[data-val="' + a + '"]').addClass('mbsc-sc-itm-inv mbsc-btn-d');
                        }
                    });
                }
                p[n] = f.multiple ? p[n] : Y(n, p[n], k);
                if (d) {
                    if (!f.multiple || e === b) {
                        f._$markup.find('.mbsc-sc-itm-sel').removeClass(w).removeAttr('aria-selected');
                    }
                    if (f.multiple) {
                        if (e === b) {
                            for (var q in g._tempSelected[n]) {
                                f._$markup.find('.mbsc-sc-itm[data-val="' + q + '"]').addClass(w).attr('aria-selected', 'true');
                            }
                        }
                    } else {
                        f._$markup.find('.mbsc-sc-itm[data-val="' + p[n] + '"]').addClass('mbsc-sc-itm-sel').attr('aria-selected', 'true');
                    }
                    i = U(f, p[n]);
                    h = i - f._index + f._batch;
                    if (Math.abs(h) > 2 * r + 1) {
                        j = h + (2 * r + 1) * (h > 0 ? -1 : 1);
                        f._offset += j;
                        f._margin -= j * o;
                        f._refresh();
                    }
                    f._index = i + f._batch;
                    f._scroller.scroll(-(i - f._offset + f._batch) * o, e === n || e === b ? m : F, l);
                }
            });
            g._tempValue = n.formatValue(p, g);
            if (d) {
                g._header.html(a4(g._tempValue));
            }
            if (g.live) {
                g._hasValue = f || g._hasValue;
                H(f, f, 0, true);
                if (f) {
                    s('onSet', {
                        valueText: g._value
                    });
                }
            }
            if (f) {
                s('onChange', {
                    valueText: g._tempValue
                });
            }
        }

        function T(a, d, e, f, g, h) {
            var c = C(a, e);
            if (c !== b) {
                p[d] = c;
                a._batch = a._array ? Math.floor(e / a._length) * a._length : 0;
                setTimeout(function() {
                    E(f, d, g, true, h);
                }, 10);
            }
        }

        function H(b, a, c, d, f) {
            if (!d) {
                E(c);
            } else {
                g._tempValue = n.formatValue(g._tempWheelArray, g);
            }
            if (!f) {
                g._wheelArray = p.slice(0);
                g._value = g._hasValue ? g._tempValue : null;
                g._selected = e(true, {}, g._tempSelected);
            }
            if (b) {
                if (g._isInput) {
                    I.val(g._hasValue ? g._tempValue : '');
                }
                s('onFill', {
                    valueText: g._hasValue ? g._tempValue : '',
                    change: a
                });
                if (a) {
                    g._preventChange = true;
                    I.trigger('change');
                }
            }
        }
        f.Frame.call(this, y, X, true);
        g.setVal = g._setVal = function(c, d, e, f, h) {
            g._hasValue = c !== null && c !== b;
            g._tempWheelArray = p = a.isArray(c) ? c.slice(0) : n.parseValue.call(y, c, g) || [];
            H(d, e === b ? d : e, h, false, f);
        };
        g.getVal = g._getVal = function(b) {
            var a = g._hasValue || b ? g[b ? '_tempValue' : '_value'] : null;
            return d.isNumeric(a) ? +a : a;
        };
        g.setArrayVal = g.setVal;
        g.getArrayVal = function(a) {
            return a ? g._tempWheelArray : g._wheelArray;
        };
        g.changeWheel = function(f, h, i) {
            var d, c;
            a.each(f, function(a, b) {
                c = N[a];
                d = c._nr;
                if (c) {
                    e(c, b);
                    S(c, d, true);
                    if (g._isVisible) {
                        if (q) {
                            c._$3d.html(t(c, d, c._first + r - u + 1, c._last - r + u, true));
                        }
                        c._$scroller.html(t(c, d, c._first, c._last)).css('margin-top', c._margin + 'px');
                        c._refresh(A);
                    }
                }
            });
            if (g._isVisible && !A) {
                g.position();
            }
            if (!A) {
                E(h, b, b, i);
            }
        };
        g.getValidValue = Y;
        g._generateContent = function() {
            var h, d = '',
                f = q ? i + 'transform: translateZ(' + (o * n.rows / 2 + 3) + 'px);' : '',
                j = '<div class="mbsc-sc-whl-l" style="' + f + 'height:' + o + 'px;margin-top:-' + (o / 2 + (n.selectedLineBorder || 0)) + 'px;"></div>',
                c = 0;
            a.each(n.wheels, function(k, i) {
                d += '<div class="mbsc-w-p mbsc-sc-whl-gr-c' + (n.showLabel ? ' mbsc-sc-lbl-v' : '') + '">' + j + '<div class="mbsc-sc-whl-gr' + (q ? ' mbsc-sc-whl-gr-3d' : '') + (z ? ' mbsc-sc-cp' : '') + '">';
                a.each(i, function(i, a) {
                    g._tempSelected[c] = e({}, g._selected[c]);
                    v[c] = S(a, c);
                    h = a.label !== b ? a.label : i;
                    d += '<div class="mbsc-sc-whl-w ' + (a.cssClass || '') + (a.multiple ? ' mbsc-sc-whl-multi' : '') + '" style="' + (n.width ? 'width:' + (n.width[c] || n.width) + 'px;' : (n.minWidth ? 'min-width:' + (n.minWidth[c] || n.minWidth) + 'px;' : '') + (n.maxWidth ? 'max-width:' + (n.maxWidth[c] || n.maxWidth) + 'px;' : '')) + '">' + '<div class="mbsc-sc-whl-o" style="' + f + '"></div>' + j + '<div tabindex="0" aria-live="off" aria-label="' + h + '"' + (a.multiple ? ' aria-multiselectable="true"' : '') + ' role="listbox" data-index="' + c + '" class="mbsc-sc-whl"' + ' style="' + 'height:' + n.rows * o * (q ? 1.1 : 1) + 'px;">' + (z ? '<div data-index="' + c + '" data-dir="inc" class="mbsc-sc-btn mbsc-sc-btn-plus ' + (n.btnPlusClass || '') + '" style="height:' + o + 'px;line-height:' + o + 'px;"></div>' + '<div data-index="' + c + '" data-dir="dec" class="mbsc-sc-btn mbsc-sc-btn-minus ' + (n.btnMinusClass || '') + '" style="height:' + o + 'px;line-height:' + o + 'px;"></div>' : '') + '<div class="mbsc-sc-lbl">' + h + '</div>' + '<div class="mbsc-sc-whl-c"' + ' style="height:' + G + 'px;margin-top:-' + (G / 2 + 1) + 'px;' + f + '">' + '<div class="mbsc-sc-whl-sc" style="top:' + (G - o) / 2 + 'px;">';
                    d += t(a, c, a._first, a._last) + '</div></div>';
                    if (q) {
                        d += '<div class="mbsc-sc-whl-3d" style="height:' + o + 'px;margin-top:-' + o / 2 + 'px;">';
                        d += t(a, c, a._first + r - u + 1, a._last - r + u, true);
                        d += '</div>';
                    }
                    d += '</div></div>';
                    c++;
                });
                d += '</div></div>';
            });
            return d;
        };
        g._attachEvents = function(b) {
            a('.mbsc-sc-btn', b).on('touchstart mousedown', a3).on('touchmove', Q).on('touchend touchcancel', R);
            a('.mbsc-sc-whl', b).on('keydown', a6).on('keyup', a2);
        };
        g._detachEvents = function(b) {
            a('.mbsc-sc-whl', b).mobiscroll('destroy');
        };
        g._markupReady = function(b) {
            O = b;
            a('.mbsc-sc-whl', O).each(function(d) {
                var h, e = a(this),
                    b = v[d],
                    f = -(b.min - b._offset + (b.multiple && !q ? Math.floor(n.rows / 2) : 0)) * o,
                    k = Math.min(f, -(b.max - b._offset - (b.multiple && !q ? Math.floor(n.rows / 2) : 0)) * o);
                b._$markup = e;
                b._$scroller = a('.mbsc-sc-whl-sc', this);
                b._$3d = a('.mbsc-sc-whl-3d', this);
                b._scroller = new c.classes.ScrollView(this, {
                    mousewheel: n.mousewheel,
                    moveElement: b._$scroller,
                    initialPos: (b._first - b._index) * o,
                    contSize: 0,
                    snap: o,
                    minScroll: k,
                    maxScroll: f,
                    maxSnapScroll: r,
                    prevDef: true,
                    stopProp: true,
                    timeUnit: 3,
                    easing: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)',
                    sync: function(c, a, d) {
                        if (q) {
                            b._$3d[0].style[j + 'Transition'] = a ? i + 'transform ' + Math.round(a) + 'ms ' + d : '';
                            b._$3d[0].style[j + 'Transform'] = 'rotateX(' + -c / o * M + 'deg)';
                        }
                    },
                    onStart: function(b, a) {
                        a.settings.readonly = V(d);
                    },
                    onGestureStart: function() {
                        e.addClass('mbsc-sc-whl-a mbsc-sc-whl-anim');
                        s('onWheelGestureStart', {
                            index: d
                        });
                    },
                    onGestureEnd: function(a) {
                        var c = a.direction == 90 ? 1 : 2,
                            e = a.duration,
                            f = a.destinationY;
                        h = Math.round(-f / o) + b._offset;
                        T(b, d, h, e, c);
                    },
                    onAnimationStart: function() {
                        e.addClass('mbsc-sc-whl-anim');
                    },
                    onAnimationEnd: function() {
                        e.removeClass('mbsc-sc-whl-a mbsc-sc-whl-anim');
                        s('onWheelAnimationEnd', {
                            index: d
                        });
                        b._$3d.find('.mbsc-sc-itm-del').remove();
                    },
                    onMove: function(a) {
                        a5(b, d, a.posY);
                    },
                    onBtnTap: function(f) {
                        var c = a(f.target),
                            e = +c.attr('data-index');
                        if (Z(d, c)) {
                            e = b._current;
                        }
                        if (s('onItemTap', {
                                target: c[0],
                                selected: c.hasClass('mbsc-itm-sel')
                            }) !== false) {
                            T(b, d, e, F, true, true);
                            if (g.live && !b.multiple && (n.setOnTap === true || n.setOnTap[d])) {
                                setTimeout(function() {
                                    g.select();
                                }, 200);
                            }
                        }
                    }
                });
            });
            E();
        };
        g._fillValue = function() {
            g._hasValue = true;
            H(true, true, 0, true);
        };
        g._clearValue = function() {
            a('.mbsc-sc-whl-multi .mbsc-sc-itm-sel', O).removeClass(w).removeAttr('aria-selected');
        };
        g._readValue = function() {
            var c = I.val() || '',
                b = 0;
            if (c !== '') {
                g._hasValue = true;
            }
            g._tempWheelArray = p = g._hasValue && g._wheelArray ? g._wheelArray.slice(0) : n.parseValue.call(y, c, g) || [];
            g._tempSelected = e(true, {}, g._selected);
            a.each(n.wheels, function(d, c) {
                a.each(c, function(c, a) {
                    v[b] = S(a, b);
                    b++;
                });
            });
            H(false, false, 0, true);
            s('onRead');
        };
        g._processSettings = function() {
            n = g.settings;
            n.cssClass = (n.cssClass || '') + ' mbsc-sc';
            s = g.trigger;
            z = n.showScrollArrows;
            q = n.scroll3d && !l && !z;
            o = n.height;
            G = q ? Math.round((o - (o * n.rows / 2 + 3) * 0.03) / 2) * 2 : o;
            x = n.multiline;
            w = 'mbsc-sc-itm-sel mbsc-ic mbsc-ic-' + n.checkIcon;
            v = [];
            N = {};
            u = Math.round(n.rows * 1.8);
            M = 360 / (u * 2);
            g._isLiquid = (n.layout || (/top|bottom/.test(n.display) && n.wheels.length == 1 ? 'liquid' : '')) === 'liquid';
            if (x > 1) {
                n.cssClass = (n.cssClass || '') + ' dw-ml';
            }
            if (z) {
                n.rows = Math.max(3, n.rows);
            }
        };
        g._getItemValue = K;
        g._tempSelected = {};
        g._selected = {};
        if (!a7) {
            g.init(X);
        }
    };
    f.Scroller.prototype = {
        _hasDef: true,
        _hasTheme: true,
        _hasLang: true,
        _hasPreset: true,
        _class: 'scroller',
        _defaults: e({}, f.Frame.prototype._defaults, {
            minWidth: 80,
            height: 40,
            rows: 3,
            multiline: 1,
            delay: 300,
            readonly: false,
            showLabel: true,
            setOnTap: false,
            wheels: [],
            preset: '',
            speedUnit: 0.0012,
            timeUnit: 0.08,
            validate: function() {},
            formatValue: function(a) {
                return a.join(' ');
            },
            parseValue: function(d, c) {
                var e = [],
                    f = [],
                    g = 0,
                    h, i;
                if (d !== null && d !== b) {
                    e = (d + '').split(' ');
                }
                a.each(c.settings.wheels, function(d, b) {
                    a.each(b, function(d, b) {
                        i = b.data;
                        h = c._getItemValue(i[0]);
                        a.each(i, function(b, a) {
                            if (e[g] == c._getItemValue(a)) {
                                h = c._getItemValue(a);
                                return false;
                            }
                        });
                        f.push(h);
                        g++;
                    });
                });
                return f;
            }
        })
    };
    c.themes.scroller = c.themes.frame;
}(window, document));


(function(a) {
    var c = mobiscroll,
        b = c.$,
        d = {
            invalid: [],
            showInput: true,
            inputClass: ''
        };
    c.presets.scroller.list = function(e) {
        var A = b.extend({}, e.settings),
            c = b.extend(e.settings, d, A),
            q = c.layout || (/top|bottom/.test(c.display) ? 'liquid' : ''),
            m = q == 'liquid',
            x = c.readonly,
            j = b(this),
            h, l, p = this.id + '_dummy',
            f = 0,
            o = 0,
            g, n = [],
            i = c.wheelArray || w(j),
            r = C(f),
            s = E(i),
            v = u(s, f);

        function G(c, d, e) {
            var a = 0,
                b = [];
            while (a < c) {
                b[a] = F(e, a, d);
                a++;
            }
            return b;
        }

        function F(f, g, h) {
            var a = 0,
                c, b = h,
                d = [];
            while (a < g) {
                var e = f[a];
                for (c in b) {
                    if (b[c].key == e) {
                        b = b[c].children;
                        break;
                    }
                }
                a++;
            }
            a = 0;
            while (a < b.length) {
                if (b[a].invalid) {
                    d.push(b[a].key);
                }
                a++;
            }
            return d;
        }

        function D(b, c) {
            var a = [];
            while (b) {
                a[--b] = true;
            }
            a[c] = false;
            return a;
        }

        function C(d) {
            var b = [],
                a;
            for (a = 0; a < d; a++) {
                b[a] = c.labels && c.labels[a] ? c.labels[a] : a;
            }
            return b;
        }

        function u(j, l, g) {
            var b = 0,
                c, h, f, e = [
                    []
                ],
                d = i;
            if (l) {
                for (c = 0; c < l; c++) {
                    if (m) {
                        e[0][c] = {};
                    } else {
                        e[c] = [{}];
                    }
                }
            }
            while (b < j.length) {
                if (m) {
                    e[0][b] = z(d, r[b]);
                } else {
                    e[b] = [z(d, r[b])];
                }
                c = 0;
                f = a;
                while (c < d.length && f === a) {
                    if (d[c].key == j[b] && (g !== a && b <= g || g === a)) {
                        f = c;
                    }
                    c++;
                }
                if (f !== a && d[f].children) {
                    b++;
                    d = d[f].children;
                } else if ((h = k(d)) && h.children) {
                    b++;
                    d = h.children;
                } else {
                    return e;
                }
            }
            return e;
        }

        function k(b, d) {
            if (!b) {
                return false;
            }
            var a = 0,
                c;
            while (a < b.length) {
                if (!(c = b[a++]).invalid) {
                    return d ? a - 1 : c;
                }
            }
            return false;
        }

        function z(b, d) {
            var c = {
                    data: [],
                    label: d
                },
                a = 0;
            while (a < b.length) {
                c.data.push({
                    value: b[a].key,
                    display: b[a].value
                });
                a++;
            }
            return c;
        }

        function y(a) {
            if (e._isVisible) {
                b('.mbsc-sc-whl-w', e._markup).css('display', '').slice(a).hide();
            }
        }

        function E(f) {
            var b = [],
                c = f,
                d, a = true,
                e = 0;
            while (a) {
                d = k(c);
                b[e++] = d.key;
                a = d.children;
                if (a) {
                    c = a;
                }
            }
            return b;
        }

        function t(f, l) {
            var j = [],
                c = i,
                d = 0,
                h = false,
                e, g, b;
            if (f[d] !== a && d <= l) {
                e = 0;
                g = f[d];
                b = a;
                while (e < c.length && b === a) {
                    if (c[e].key == f[d] && !c[e].invalid) {
                        b = e;
                    }
                    e++;
                }
            } else {
                b = k(c, true);
                g = c[b].key;
            }
            h = b !== a ? c[b].children : false;
            j[d] = g;
            while (h) {
                c = c[b].children;
                d++;
                h = false;
                b = a;
                if (f[d] !== a && d <= l) {
                    e = 0;
                    g = f[d];
                    b = a;
                    while (e < c.length && b === a) {
                        if (c[e].key == f[d] && !c[e].invalid) {
                            b = e;
                        }
                        e++;
                    }
                } else {
                    b = k(c, true);
                    b = b === false ? a : b;
                    g = c[b].key;
                }
                h = b !== a && k(c[b].children) ? c[b].children : false;
                j[d] = g;
            }
            return {
                lvl: d + 1,
                nVector: j
            };
        }

        function w(d) {
            var c = [];
            f = f > o++ ? f : o;
            d.children('li').each(function(k) {
                var d = b(this),
                    f = d.clone();
                f.children('ul,ol').remove();
                var i = e._processMarkup ? e._processMarkup(f) : f.html().replace(/^\s\s*/, '').replace(/\s\s*$/, ''),
                    j = d.attr('data-invalid') ? true : false,
                    g = {
                        key: d.attr('data-val') === a || d.attr('data-val') === null ? k : d.attr('data-val'),
                        value: i,
                        invalid: j,
                        children: null
                    },
                    h = d.children('ul,ol');
                if (h.length) {
                    g.children = w(h);
                }
                c.push(g);
            });
            o--;
            return c;
        }

        function B(c, i, f) {
            var a, b = (i || 0) + 1,
                g = [],
                d = {},
                h = {};
            d = u(c, null, i);
            for (a = 0; a < c.length; a++) {
                e._tempWheelArray[a] = c[a] = f.nVector[a] || 0;
            }
            while (b < f.lvl) {
                h[b] = m ? d[0][b] : d[b][0];
                g.push(b++);
            }
            y(f.lvl);
            n = c.slice(0);
            if (g.length) {
                l = true;
                e.changeWheel(h);
            }
        }
        b('#' + p).remove();
        if (c.showInput) {
            h = b('<input type="text" id="' + p + '" value="" class="' + c.inputClass + '" placeholder="' + (c.placeholder || '') + '" readonly />').insertBefore(j);
            c.anchor = h;
            e.attachShow(h);
        }
        if (!c.wheelArray) {
            j.hide();
        }
        return {
            wheels: v,
            layout: q,
            headerText: false,
            setOnTap: f == 1,
            formatValue: function(b) {
                if (g === a) {
                    g = t(b, b.length).lvl;
                }
                return b.slice(0, g).join(' ');
            },
            parseValue: function(a) {
                return a ? (a + '').split(' ') : (c.defaultValue || s).slice(0);
            },
            onBeforeShow: function() {
                var a = e.getArrayVal(true);
                n = a.slice(0);
                c.wheels = u(a, f, f);
                l = true;
            },
            onWheelGestureStart: function(a) {
                c.readonly = D(f, a.index);
            },
            onWheelAnimationEnd: function(f) {
                var a = f.index,
                    b = e.getArrayVal(true),
                    d = t(b, a);
                g = d.lvl;
                c.readonly = x;
                if (b[a] != n[a]) {
                    B(b, a, d);
                }
            },
            onFill: function(b) {
                g = a;
                if (h) {
                    h.val(b.valueText);
                }
            },
            validate: function(e) {
                var b = e.values,
                    d = e.index,
                    c = t(b, b.length);
                g = c.lvl;
                if (d === a) {
                    y(c.lvl);
                    if (!l) {
                        B(b, d, c);
                    }
                }
                l = false;
                return {
                    disabled: G(g, i, b)
                };
            },
            onDestroy: function() {
                if (h) {
                    h.remove();
                }
                j.show();
            }
        };
    };
}());
window.mobiscroll = mobiscroll